FROM golang:1.15

WORKDIR /root

ADD .. .
RUN go env -w GOPROXY=https://goproxy.cn,direct && go env -w GOPRIVATE="code.aibee.cn/*"
RUN go mod vendor
RUN go build

FROM kublr/alpine-plus
WORKDIR /root
COPY --from=builder /root/main /root/main
RUN ln -s /root/main /bin/main